<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>活动内容列表-添加活动</title>
<link href="/zhenze/Public/admin/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="/zhenze/Public/admin/js/jquery.js"></script>

<link href="/zhenze/Public/validform/Validform.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/zhenze/Public/validform/Validform_v5.3.2.js"></script>
<script type="text/javascript" src="/zhenze/Public/validform/Validform_Datatype.js"></script>

<link href="/zhenze/Public/admin/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/zhenze/Public/admin/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="/zhenze/Public/admin/js/select-ui.min.js"></script>

<link rel="stylesheet" href="/zhenze/Public/kindeditor/themes/default/default.css" />
<script type="text/javascript" src="/zhenze/Public/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" src="/zhenze/Public/kindeditor/lang/zh-CN.js"></script>

<script type="text/javascript" src="/zhenze/Public/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[id="content"]', {
		uploadJson : '<?php echo U('kindeditor/upload_json',array('dir'=>image));?>',
		fileManagerJson : '<?php echo U('kindeditor/file_manager_json');?>',
		allowFileManager : true,
		urlType : 'domain',
		afterCreate : function() {
			this.sync(); 
		},
		afterBlur:function(){ 
			this.sync(); 
		}
	});

	var uploadbutton = K.uploadbutton({
		button : K('#uploadButton')[0],
		fieldName : 'imgFile',
		url : '<?php echo U('kindeditor/upload_json',array('dir'=>image));?>',
		afterUpload : function(data) {
			if (data.error === 0) {
				var url = K.formatUrl(data.url, 'domain');
				K('#image').val(url);
			} else {
				alert(data.message);
			}
		},
		afterError : function(str) {
			alert('自定义错误信息: ' + str);
		}
	});
	uploadbutton.fileBox.change(function(e) {
		uploadbutton.submit();
	});
});
$(document).ready(function(e) {
    $("#classtypes").uedSelect({
		width : 150			  
	});
});
</script>
</head>

<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="<?php echo U('index/index');?>">首页</a></li>
			<li><a href="<?php echo U('eventinfo/index');?>">活动内容列表</a></li>
			<li><a href="#">添加活动</a></li>
		</ul>
    </div>
    
    <div class="formbody">
    
		<div class="formtitle"><span>添加活动</span></div>

		<form name="myform" id="myform" action="<?php echo U('eventinfo/addeventinfo');?>" method="post">
			<ul class="forminfo">
				<li><label>活动标题</label><input name="info[event_title]" id="title" type="text" class="dfinput" datatype="*" errormsg="标题不能为空！" maxlength="50" /><i class="Validform_checktip"></i></li>
				
				
				<li><label>默认图片</label><input name="info[event_image]" id="image" type="text" class="dfinput" value="" readonly/>&nbsp;<input type="button" id="uploadButton" value="上传" /><i class="Validform_checktip"></i></li>

				<li><label>开始时间</label><input name="info[event_starttime]" id="starttime" class="dfinput" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{ $dp.$D(\'endtime\')||\'2100-10-01\' }'})" datatype="*" errormsg="时间范围开始值不能为空！" maxlength="20" style="width: 130px;" readonly value="<?php echo ($starttime); ?>" /></li>

				<li><label>结束时间</label><input name="info[event_endtime]" id="endtime" class="dfinput" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{ $dp.$D(\'starttime\') }',maxDate:'2100-10-01'})" datatype="*" errormsg="时间范围结束值范围不能为空！" maxlength="20" style="width: 130px;" readonly value="<?php echo ($endtime); ?>" /></li>
				
				<li><label>选择商家</label>
					<div class="vocation">
						<select id="classtypes" name="info[event_admin]" style="width:150px;" datatype="*" errormsg="商家不能为空！">
							<option value="">请选择商家</option>
							<?php if(is_array($class_type)): $i = 0; $__LIST__ = $class_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data["admin_id"]); ?>"><?php echo ($data["username"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						</select>
					</div>
					<i class="Validform_checktip"></i>
				</li>

				<li><label>简介</label><textarea name="info[event_description]" id="event_description" cols="" rows="" class="textinput" style="height: 50px;" datatype="*" errormsg="简介不能为空！" maxlength="200"></textarea></li>

				<li><label>内容</label><textarea name="info[event_content]" id="content" cols="" rows="" class="textinput" style="height: 250px;width:700px;"></textarea></li>

				<li><label>&nbsp;</label><input name="btn" type="submit" class="btn" value="确认保存"/></li>
			</ul>
		</form>
    
    </div>

	<script>
	$(function(){
		$("#myform").Validform({
			//tiptype:2
			tiptype:function(msg,o,cssctl){
				var objtip=o.obj.siblings(".Validform_checktip");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}
		});
	}); 
	</script>
</body>

</html>